package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * Created by ChenYong on 2017-04-17.
 * <br>
 * 添加学习资料的请求参数。
 */
public class AddLearnFileDataParam {
    /**
     * 资料标题
     */
    @NotBlank(message = "资料标题不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_500, message = "资料标题的长度在1至500个字之间")
    private String learnName;
    /**
     * 资料内容
     */
    @NotBlank(message = "资料内容不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_2000, message = "资料内容的长度在1至2000个字之间")
    private String learnContent;
    /**
     * 资料附件的名称，多个名称用“|”分隔
     */
    @Pattern(regexp = Constants.STR_SPLIT_EMPTY_RE, message = "资料附件的名称格式不正确")
    private String learnFileNames;
    /**
     * 资料附件的路径，多个名称用“|”分隔
     */
    @Pattern(regexp = Constants.STR_SPLIT_EMPTY_RE, message = "资料附件的路径格式不正确")
    private String learnFilePaths;
    /**
     * 资料类型
     */
    @NotBlank(message = "资料类型不能为空")
    @Pattern(regexp = Constants.INDUSTRY_CODE_RE, message = "资料类型由“一个大写字母+数字”组成，最多不超过10个字符")
    private String learnType;

    /**
     * 默认构造器。
     */
    public AddLearnFileDataParam() {
        super();
    }

    public String getLearnName() {
        return learnName;
    }

    public void setLearnName(String learnName) {
        this.learnName = learnName;
    }

    public String getLearnContent() {
        return learnContent;
    }

    public void setLearnContent(String learnContent) {
        this.learnContent = learnContent;
    }

    public String getLearnFileNames() {
        return learnFileNames;
    }

    public void setLearnFileNames(String learnFileNames) {
        this.learnFileNames = learnFileNames;
    }

    public String getLearnFilePaths() {
        return learnFilePaths;
    }

    public void setLearnFilePaths(String learnFilePaths) {
        this.learnFilePaths = learnFilePaths;
    }

    public String getLearnType() {
        return learnType;
    }

    public void setLearnType(String learnType) {
        this.learnType = learnType;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("AddLearnFileDataParam{");
        sb.append("learnName='").append(learnName).append('\'');
        sb.append(", learnContent='").append(learnContent).append('\'');
        sb.append(", learnFileNames='").append(learnFileNames).append('\'');
        sb.append(", learnFilePaths='").append(learnFilePaths).append('\'');
        sb.append(", learnType='").append(learnType).append('\'');
        sb.append('}');
        return sb.toString();
    }
}